<template>
  <base-breadcrumb class="flexMemberInfo-container">
    <a-spin :spinning="loading">
        <a-card>
          <titleName title="基本信息" />
          <custom-form
            ref="CustomForm"
            class="flex-form"
            :form="form"
            :form-list="formList"
            :edit-model="''"
            >
          </custom-form>

        </a-card>
    </a-spin>

    <div class="pub-header-btn page-btn-right-top">
      <a-button type="default"  @click="$close">关闭</a-button>
    </div>
  </base-breadcrumb>
</template>

<script>
  // import Vue from 'vue'
  import { getProgramDetail } from '@/api/technical/approvalPlan'
  import UploadList from '@/components/UploadList'
  export default {
    props:{
    },
    components:{
      UploadList
    },
    data(){
      return{
        loading:false,
        form: {
          branchComName: "",
          projectName: "",
          pictureVO: [],
          viewName: ""
        },
      }
    },
    watch:{
    },
    computed: {
        formList() {
          return [
            {
              label: '所属单位',
              keyName: 'viewName',
              type: 'BaseInput',
              disabled: true,
              span: 16
            },
          // {
          //   label: '分公司',
          //   keyName: 'branchComName',
          //   type: 'BaseInput',
          //   disabled: true
          // },
          // {
          //   label: '项目名称',
          //   keyName: 'projectName',
          //   type: 'BaseInput',
          //   disabled: true
          // },
          {
            label: '方案类别',
            keyName: 'programTypeName',
            type: 'BaseInput',
            disabled: true
          },
          {
            label: '方案名称',
            keyName: 'programName',
            type: 'BaseInput',
            disabled: true
          },
          {
            label: '实施记录人',
            keyName: 'recordName',
            type: 'BaseInput',
            disabled: true
          },
          {
            label: '实施登记时间',
            keyName: 'recordDate',
            type: 'BaseInput',
            disabled: true
          },
          {
            label: '填报人',
            keyName: 'creatorName',
            type: 'BaseInput',
            disabled: true
          },
          {
            label: '填报时间',
            keyName: 'createTime',
            type: 'BaseInput',
            disabled: true
          },
          {
            label: '方案与现场偏差',
            keyName: 'deviation',
            type: 'BaseTextarea',
            disabled: true,
            span: 24
          },
          {
            label: '现场问题照片',
            keyName: 'pictureVO',
            type: UploadList,
            disabled: true,
            span: 24,
            attrs: {
              uploadType: 'image',
              isMultiple: true,
              editModel: '0',
              uploadArrys: this.form.pictureVO || []
            },
          },
          {
            label: '限期整改措施',
            keyName: 'rectification',
            type: 'BaseTextarea',
            disabled: true,
            span: 24
          },
          {
            label: '',
            keyName: 'rectificationPictureVO',
            type: UploadList,
            disabled: true,
            span: 24,
            attrs: {
              uploadType: 'image',
              isMultiple: true,
              editModel: '0',
              uploadArrys: this.form.rectificationPictureVO || [],
              style: {
                marginLeft: '135px'
              }
            },
          },
        ]
      }
    },
    created() {
    },
    mounted() {
      this.getDetail()
    },
    methods:{
      getDetail() {
        this.loading = true
        getProgramDetail(this.$route.query.id).then((res) => {
          this.loading = false
          if (res.code == 200) {
            this.form = res.data
            this.form.viewName = this.form.branchComName + "/" + this.form.projectName
          }
        }).catch(() => {
          this.loading = false
        })
      }
    }
  }
</script>

<style lang="less">
  .flex-form .ant-form-item{
    display: flex;
  }
</style>
